//
//  BaseViewController.swift
//  V2ex-Swift
//
//  Created by Jasper on 2/28/16.
//  Copyright © 2016 Fin. All rights reserved.
//

import UIKit


class RootViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.view.backgroundColor = UIColor.viewBackColor()
        
        navigationController?.navigationBar.barStyle = .default
        navigationController?.navigationBar.tintColor = UIColor.white
        tabBarController?.tabBar.tintColor = UIColor.mainColor();
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
//        if ((navigationController?.respondsToSelector("interactivePopGestureRecognizer")) != nil) {
//            navigationController?.interactivePopGestureRecognizer?.delegate = nil
//        }
    }

    
//    func setNavigationItemWithTitle(title:String) {
    
//        let goBackButton = UIButton(type: .Custom)
//        goBackButton.setImage(UIImage(named: "barbuttonicon_back"), forState: .Normal)
//        goBackButton.frame = CGRectMake(0, 0, 18, 30)
//        goBackButton.addTarget(self, action: "goBack", forControlEvents: .TouchUpInside)
//        let goBackItem1 = UIBarButtonItem(customView: goBackButton)
//        
//        let goBackButton2 = UIButton(type: .Custom)
//        goBackButton2.setTitle(title, forState: .Normal)
//        goBackButton2.frame = CGRectMake(0, 0, 40, 30)
//        goBackButton2.titleEdgeInsets = UIEdgeInsetsMake(0, -26, 0, 0)
//        goBackButton2.addTarget(self, action: "goBack", forControlEvents: .TouchUpInside)
//        let goBackItem2 = UIBarButtonItem(customView: goBackButton2)
//        
//        let fixItem = UIBarButtonItem(barButtonSystemItem: .FixedSpace, target: nil, action: nil)
//        fixItem.width = -10
//        self.navigationItem.leftBarButtonItems = [fixItem, goBackItem1, goBackItem2]
        
//    }
    
//    func goBack() {
//        self.navigationController!.popViewControllerAnimated(true)
//    }
}


////ViewA的controller中调用
//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
//{
//    //获取到ViewB的controller
//    UIViewController* viewController = [segue destinationViewController];
//    //ToDo传递参数
//    ...
//}
